As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label Google Visualization API. Show all posts

A picture is worth a thousand words:


Probably one more is better:



You can read the installation instructions if you want to have it on your blog. It's a script to convert Blogger's Blog Archive into a bar chart using Column Chart of Google Visualization API. Since the API is interactive, you will still be able to click and to view the archive from the chart.

The only restriction is you must use dropdown menu style, I only write the parser for that, you can still choose one of Monthly, Weekly, and Daily. The chart will draw accordingly. The color is default to gray bars, but you can customize the chart.

I got this idea when I was reading this month's post count after I just finished something on GitHub. The GitHub's commits timeline chart gave me this inspiration.

My original idea was writing a Blogger Gadget, unfortunately, I saw no way to retrieve same data as Blog Archive receives. The only way is to process a list of published dates via JSON API with Partial Fields. It's not really a big deal, but for long-lasted blog, it may have thousands of posts. It's really not so efficient.

I decided to parse the dropdown menu of Blog Archive gadget, not perfect but better than previous way in my opinion. Later, I rewrote a bit and wrote a Blog Archive XML, so no dropdown menu will be rendered, which you probably only would see in a blink if you install this barchart'd code with parsing method.

The installation is really easy either your modify template or simply add two lines to an HTML/JavaScript gadget, that's all you need to do.

I put the code with BloggerGadgets.js, and moved the repository to GitHub, because the file hosting need. I wished I could keep the code on Bitbucket, but I couldn't, tried hg-git, but it hanged when I tried to push to gh-pages branch via hg bookmark.

Feedback is welcome, feel free to add your thoughts in comments. For bugs, please create an issue on GitHub.

This is another not so useful script of mine. It is a Bash script and it gathers the search results counts via Google/Yahoo/Bing APIs to make an historical chart of specified keyword using the Annotated Timeline (with no annotations, :-))of Google Visualization API.

I made this script, search-result-count.sh, because I wanted to have a historical chart of this keyword livibetter. Yep, I searched my nickname regularly, I admit it! I like watching the number of result climbing up, which would make me feel better. :-D

I wasn't planning of using Yahoo and Bing because their APIs require AppIDs, the IDs will be out to apparently public if I use Bash to write this. I don't like it, but I couldn't resist to see the result counts from them.

Because it is still new, I could not have much data to show you. The following chart was collected about two weeks. (Bing results was not included)



The following is the screenshot of rendered HTML page:

I googled myself and made a chart. on Twitpic

Please aware of few things if you want to use this script:
  • You can use cron to run it regularly, several times a day. Don't worry, it will only update the data file once a day.
  • It will only update when three counts from three search engine are available. If any of them couldn't return the result, you may have a missing data. But it should be okay, the counts do not change much from day to day.